class classRoom {
  constructor(address, name, students) {
    this.address = address
    this.name = name
    this.students = students
  }

  entry(student) {
    this.students.push(student)
  }

  *[Symbol.iterator]() {
    yield* this.students
  }
}

const cr1 = new classRoom('bj', 'computer', ['jack', 'josh', 'lucy'])
cr1.entry('dd')
for (const cr1Element of cr1) {
  // console.log(cr1Element)
  if (cr1Element === 'dd') break
  console.log(cr1Element)
}
